import { defineStore } from 'pinia'
import { ref } from 'vue'
const useUserStore = defineStore(
    'user',
    () => {
        const userInfo = ref({})

        const setUserInfo = (info) => {
            userInfo.value = info
        }

        const setNickname = (nickname) => {
            userInfo.value.nickname = nickname
        }

        return {
            userInfo,
            setUserInfo,
            setNickname,
        }
    },
    {
        persist: true,
    },
)
export default useUserStore;
